package com.noocodecommit.wicket.jquery.plugin.poll;

import java.util.ArrayList;
import java.util.List;

import com.noocodecommit.wicket.jquery.TemplatePage;
import com.noocodecommit.wicket.stuff.jquery.JQCore;
import com.noocodecommit.wicket.stuff.jquery.plugin.chili.JQChili;
import com.noocodecommit.wicket.stuff.jquery.plugin.poll.JQPoll;
import com.noocodecommit.wicket.stuff.jquery.plugin.poll.PollData;
import com.noocodecommit.wicket.stuff.jquery.plugin.ui.tabs.JQTabs;

public class PollPage extends TemplatePage
{
	private final JQTabs tabContainer;

	public PollPage()
	{
		super();
		JQCore.init(this);
		this.setupChili();

		tabContainer = new JQTabs("tab-container");
		tabContainer.setOutputMarkupId(true);
		add(tabContainer);
		
		List<String> listFwk = new ArrayList<String>();
		listFwk.add("jQuery");
		listFwk.add("Ext JS");
		listFwk.add("Dojo");
		listFwk.add("Prototype");
		listFwk.add("YUI");
		listFwk.add("mootools");

		PollData data = new PollData("Pick your favorite Javascript framework", listFwk);

		tabContainer.add(new JQPoll("poll", data, "poll"));

		JQChili chili1 = new JQChili("chili1");
		add(chili1);
		this.bindChiliCode(chili1, this.getClass(), "html");

		JQChili chili2 = new JQChili("chili2");
		add(chili2);
		this.bindChiliCode(chili2, this.getClass(), "java");

		JQCore.get().bindOnDocumentReadyFunction();
	}
}